<?php 
$server='HongKong';
if ('winstongardencn.harrywinston-digital.com' == $_SERVER['HTTP_HOST']){
    $server='Mainland';
    $lang='zh';
    $title='探索温斯顿花园秘境';
    $desc='不可思议的自然芳华，尽在温斯顿花园翩然绽放';
    $link='http://winstongardencn.harrywinston-digital.com/2019/';
}else{
    $lang='xg';
    $title='探索溫斯頓花園秘境';
    $desc='不可思議的自然芳華，盡在溫斯頓花園翩然綻放';
    $link='http://winstongarden.harrywinston-digital.com/2019/';
}
$langTu=array('xg'=>'1','zh'=>'2','en'=>'3');
include_once './jssdk.php';
$appId = 'wx3464c6b9fd10bf5c';
$secret = '14261ef0ece5d043f5bdea33eabee81b';
$jssdk = new JSSDK($appId, $secret);
$signPackage = @$jssdk->GetSignPackage();
$isMo=false;
if (file_exists('mo.txt')){
	$isMo=true;
}
?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>Welcome to Winston Garden</title>
<link rel="stylesheet" href="./swiper.min.css">
<style>
html,body{width:100%;font-size:12px;font-family:Helvetica,Tahoma, Arial, STXihei,Microsoft YaHei, Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;}
body{position:relative;background:#d2dbec;}
body, div{padding:0px;margin:0px auto;max-width:750px;}
.weui-dialog{position:fixed;z-index:5000;width:80%;max-width:300px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#FFF;text-align:center;border-radius:3px;overflow:hidden}.weui-dialog__hd{padding:1.3em 1.6em .5em}.weui-dialog__title{font-weight:400;font-size:18px}.weui-dialog__bd{padding:0 1.6em .8em;min-height:40px;font-size:15px;line-height:1.3;word-wrap:break-word;word-break:break-all;color:#999}.weui-dialog__bd:first-child{padding:1.2em 20px .1em;color:#353535}.weui-dialog__ft{position:relative;line-height:48px;font-size:18px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3CC51F;text-decoration:none;-webkit-tap-highlight-color:transparent;position:relative}.weui-dialog__btn:active{background-color:#EEE}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:#353535}.weui-dialog__btn_primary{color:#0BB20C}@media screen and (min-width:1024px){.weui-dialog{width:35%}}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,.6)}
.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}
.js_dialog{display:none;}
-webkit-touch-callout:none;
-webkit-user-select:none;
html{-ms-touch-action:none;}
div,img{-webkit-tap-highlight-color:rgba(0,0,0,0);}
*{-webkit-text-size-adjust: none;}
.simg{position:absolute;display:block;}
a{text-decoration:none;}
.txt{position:absolute;text-indent:8px;color:#000;font-size:12px;z-index:2;border:none;background:transparent;}
.txt::-webkit-input-placeholder {text-align:left;}
select{position:absolute;color:#000;display:block;background:transparent;border:0px;text-indent:10px;font-size:12px;-webkit-appearance:none;}
.container{position:relative;width:100%;height:auto;overflow:hidden;}
.page{position:absolute;width:100%;height:100%;display:none;}
.bg{position:absolute;width:100%;top:0;left:0;}
.p1{position:relative;width:100%;height:100%;opacity:0;}
.hide{display:none;}
.slider1, .slider2{width:100%;}
.swiper-slide img{width:100%;height:100%;}
.p1-block{position:relative;width:100%;}
.b1{height:50%;}
.langa, .langb{z-index:3;}
</style></head><body>
<div class="container">
 <div class="p1">
     <img class="bg simg" src="./img/bg.jpg" />
     <img class="lang simg" src="./img/lang<?php echo $langTu[$lang] ?>.png" />
     <div class="langa simg"></div>
     <div class="langb simg"></div>
     <img class="p-t1 simg" src="./img/t1-<?php echo $lang ?>.png?v=2" />
     <img class="p-t2 simg" src="./img/t2-<?php echo $lang ?>.png?v=2" />
     <img class="p-t3 simg" src="./img/t3-<?php echo $lang ?>.png?v=2" />
     <img class="p-t4 simg" src="./img/t4-<?php echo $lang ?>.png?v=2" />
     <?php if ($isMo){ ?>
      <img class="p-t5 simg" src="./img/ao-<?php echo $lang ?>.png?v=3" />
     <?php }else{ ?>
      <img class="p-t5 simg" src="./img/t5-<?php echo $lang ?>.png?v=3" />
     <?php } ?>
     <div class="p1-block b1"></div>
     <div class="p1-block b2">
         <div class="swiper-container slider1">
        	<div class="swiper-wrapper">
                <div class="swiper-slide s1-1"><img src="./img/<?php echo $lang ?>/s1-1.png?v=3" /></div>
                <div class="swiper-slide s1-2"><img src="./img/<?php echo $lang ?>/s1-2.png?v=3" /></div>
                <div class="swiper-slide s1-3"><img src="./img/<?php echo $lang ?>/s1-3.png?v=3" /></div>
                <div class="swiper-slide s1-4"><img src="./img/<?php echo $lang ?>/s1-4.png?v=3" /></div>
            </div>
            <div class="swiper-pagination"></div>
         </div>
     </div>
     <div class="p1-block b3">
        <div class="swiper-container slider2">
        	<div class="swiper-wrapper">
                <div class="swiper-slide s2-1"><img src="./img/<?php echo $lang ?>/s2-1.png" /></div>
                <div class="swiper-slide s2-2"><img src="./img/<?php echo $lang ?>/s2-2.png" /></div>
                <div class="swiper-slide s2-3"><img src="./img/<?php echo $lang ?>/s2-3.png" /></div>
                <div class="swiper-slide s2-4"><img src="./img/<?php echo $lang ?>/s2-4.png" /></div>
                <div class="swiper-slide s2-5"><img src="./img/<?php echo $lang ?>/s2-5.png" /></div>
            </div>
            <div class="swiper-pagination"></div>
         </div>
     
     </div>
     
     <div class="p1-block b4">
        <div class="swiper-container slider3">
        	<div class="swiper-wrapper">
                <div class="swiper-slide s3-1"><img src="./img/<?php echo $lang ?>/s3-1.png" /></div>
                <div class="swiper-slide s3-2"><img src="./img/<?php echo $lang ?>/s3-2.png" /></div>
                <div class="swiper-slide s3-3"><img src="./img/<?php echo $lang ?>/s3-3.png" /></div>
                <div class="swiper-slide s3-4"><img src="./img/<?php echo $lang ?>/s3-4.png" /></div>
            </div>
            <div class="swiper-pagination"></div>
         </div>
         
         <div class="gosite simg"></div>
     
     </div>
     
     
     
     
     
     
 
 </div>
 
</div>
<?php 
if ('winstongardencn.harrywinston-digital.com' == $_SERVER['HTTP_HOST']){
?>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://cdn.mei94.com/web/js/pxloader-images.min.js"></script>
<?php }else{ ?>
<script src="./jquery.min.js"></script>
<script src="./pxloader-images.min.js"></script>
<?php } ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script src="./swiper.jquery.min.js"></script>
<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
 
var _img=['bg.jpg'];
var loader = new PxLoader();
for(var i=0; i<_img.length; i++){loader.addImage('./img/'+_img[i]);}
loader.start();
loader.addCompletionListener(function(e){
	$(".p1").css({"opacity":1}).hide().fadeIn();
});
var _lang='<?php echo $lang; ?>';
var _langTu=<?php echo json_encode($langTu); ?>;
var _link='<?php echo $link; ?>';
var _imgUrl='http://winstongardencn.harrywinston-digital.com/2019gift/img/64.jpg';
$(function(){
	$('.container').width(sWidth).height(_rate*6101);
	$('.lang').width(_rate*213).height(_rate*99).css({"top":0, "left":0});
	$('.langa, .langb').width(_rate*213).height(_rate*49).css({"left":0});
	$('.langa').css({"top":0});
	$('.langb').css({"top":_rate*50});
	$('.p-t1').width(sWidth).height(_rate*986).css({"top":_rate*240, "left":0});
	$('.p-t2').width(sWidth).height(_rate*427).css({"top":_rate*1770, "left":0});
	$('.p-t3').width(sWidth).height(_rate*562).css({"top":_rate*2724, "left":0});
	$('.p-t4').width(sWidth).height(_rate*373).css({"top":_rate*4074, "left":0});
	$('.p-t5').width(sWidth).height(_rate*569).css({"top":_rate*5444, "left":0});
	$('.slider1, .slider1 .swiper-slide').width(sWidth).height(_rate*525);
	$('.slider2, .slider2 .swiper-slide').width(sWidth).height(_rate*617);
	$('.slider3, .slider3 .swiper-slide').width(sWidth).height(_rate*695);
	$('.gosite').width(_rate*380).height(_rate*90).css({"top":_rate*1240, "left":_rate*190});
	
	
	$('.b1').height(_rate*2068);
	$('.b2').height(_rate*1262);
	$('.b3').height(_rate*1350);

	var swiper1 = new Swiper('.slider1', {
        pagination: '.swiper-pagination',
        autoplay: 2000,
        paginationClickable: true,
        speed: 900,
        autoplayDisableOnInteraction : false,
        loop: true
    });
	swiper1.stopAutoplay();
	var swiper2 = new Swiper('.slider2', {
        pagination: '.swiper-pagination',
        autoplay: 2000,
        paginationClickable: true,
        speed: 900,
        autoplayDisableOnInteraction : false,
        loop: true
    });
	swiper2.stopAutoplay();
	var swiper3 = new Swiper('.slider3', {
        pagination: '.swiper-pagination',
        autoplay: 2000,
        paginationClickable: true,
        speed: 900,
        autoplayDisableOnInteraction:false,
        loop: true
    });
	swiper3.stopAutoplay();
  
    var _play1=true;
    var _play2=true;
    var _play3=true;
	function sendAsk(){
		var lis= $('.p1-block').find(".swiper-container");
    	    var swHeight=$(window).height();
            $.each(lis, function (index, item) {
                mTop=item.getBoundingClientRect().top;
                if(mTop<=swHeight){
                    console.log(index);
                    if(0 == index && _play1){
                    	_play1=false;
                    	window.setTimeout(function(){swiper1.startAutoplay();}, 200);
                    }
                    if(1 == index && _play2){
                    	_play2=false;
                    	window.setTimeout(function(){swiper2.startAutoplay();}, 200);
                    }
                    if(2 == index && _play3){
                    	_play3=false;
                    	window.setTimeout(function(){swiper3.startAutoplay();}, 1200);
                    }
 
                	 
                }
            });
    }
 
	window.addEventListener("scroll",function(e){
		sendAsk();
	});
	$('.gosite').click(function(){
	   gtag('event', 'click', {
		   'event_category' : 'button click',
		   'event_label' : '按钮点击'
		 });
       window.location.href='go.php?l='+_lang;
    });
	$('.langa').css({"top":0});
	$('.langb').css({"top":_rate*50});
	console.log(_lang);
	function _update(_lang){
		console.log(_lang);
		$(".lang").attr('src', './img/lang'+_langTu[_lang]+'.png');
		$(".p-t1").attr('src', './img/t1-'+_lang+'.png');
		$(".p-t2").attr('src', './img/t2-'+_lang+'.png');
		$(".p-t3").attr('src', './img/t3-'+_lang+'.png');
		$(".p-t4").attr('src', './img/t4-'+_lang+'.png');
        <?php if ($isMo){ ?>
        $(".p-t5").attr('src', './img/ao-'+_lang+'.png?v=3');
        <?php }else{ ?>
        $(".p-t5").attr('src', './img/t5-'+_lang+'.png?v=3');
        <?php } ?>
		$(".s1-1 img").attr('src', './img/'+_lang+'/s1-1.png');
		$(".s1-2 img").attr('src', './img/'+_lang+'/s1-2.png');
		$(".s1-3 img").attr('src', './img/'+_lang+'/s1-3.png');
		$(".s1-4 img").attr('src', './img/'+_lang+'/s1-4.png');
		$(".s2-1 img").attr('src', './img/'+_lang+'/s2-1.png');
		$(".s2-2 img").attr('src', './img/'+_lang+'/s2-2.png');
		$(".s2-3 img").attr('src', './img/'+_lang+'/s2-3.png');
		$(".s2-4 img").attr('src', './img/'+_lang+'/s2-4.png');
		$(".s2-5 img").attr('src', './img/'+_lang+'/s2-5.png');
		$(".s3-1 img").attr('src', './img/'+_lang+'/s3-1.png');
		$(".s3-2 img").attr('src', './img/'+_lang+'/s3-2.png');
		$(".s3-3 img").attr('src', './img/'+_lang+'/s3-3.png');
		$(".s3-4 img").attr('src', './img/'+_lang+'/s3-4.png');
	}

	wx.config({
    	appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,
    	nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',
    	jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage','onMenuShareQQ','showMenuItems','showOptionMenu','updateAppMessageShareData','updateTimelineShareData']
    });
	wx.ready(function (){
		var _title='<?php echo $title; ?>';
		var _desc='<?php echo $desc; ?>';
		wx.updateAppMessageShareData({ 
	        title: _title,  
	        desc: _desc,  
	        link: _link,  
	        imgUrl: _imgUrl,  
	        success: function () {}
	    })
	    wx.updateTimelineShareData({ 
            title: _desc, 
            link: _link, 
            imgUrl: _imgUrl,
            success: function () {
            }
        }) 	
	});

	
	$(".langa").click(function(){
		var _langTmp=_lang;
        if('en' == _langTmp){_lang='zh';}
        if('zh' == _langTmp){_lang='xg';}
        if('xg' == _langTmp){_lang='zh';}
        _update(_lang);
        if('en' == _lang){
        	var _title='Welcome to Winston Garden';
 			var _desc='A garden of incredible blooming nature';
 			gtag('event', 'click', {'event_category' : 'CHS','event_label' : 'CHS'});
        }
        if('zh' == _lang){
        	var _title='探索温斯顿花园秘境';
 			var _desc='不可思议的自然芳华，尽在温斯顿花园翩然绽放';
 			gtag('event', 'click', {'event_category' : 'NEG','event_label' : 'NEG'});
        }
        if('xg' == _lang){
        	var _title='探索溫斯頓花園秘境';
 			var _desc='不可思議的自然芳華，盡在溫斯頓花園翩然綻放';
 			gtag('event', 'click', {'event_category' : 'CHT','event_label' : 'CHT'});
        }
        wx.updateAppMessageShareData({ 
	        title: _title,  
	        desc: _desc,  
	        link: _link,  
	        imgUrl: _imgUrl,  
	        success: function () {}
	    })
	    wx.updateTimelineShareData({ 
            title: _desc, 
            link: _link, 
            imgUrl: _imgUrl,
            success: function () {
            }
        })
	});
	$(".langb").click(function(){
		var _langTmp=_lang;
		if('en' == _langTmp){_lang='xg';}
		if('xg' == _langTmp){_lang='en';}
		if('zh' == _langTmp){_lang='en';}
		_update(_lang);

		if('en' == _lang){
        	var _title='Welcome to Winston Garden';
 			var _desc='A garden of incredible blooming nature';
        }
        if('zh' == _lang){
        	var _title='探索温斯顿花园秘境';
 			var _desc='不可思议的自然芳华，尽在温斯顿花园翩然绽放';
        }
        if('xg' == _lang){
        	var _title='探索溫斯頓花園秘境';
 			var _desc='不可思議的自然芳華，盡在溫斯頓花園翩然綻放';
        }
       
		wx.updateAppMessageShareData({ 
	        title: _title,  
	        desc: _desc,  
	        link: _link,  
	        imgUrl: _imgUrl,  
	        success: function () {}
	    })
	    wx.updateTimelineShareData({ 
            title: _desc, 
            link: _link, 
            imgUrl: _imgUrl,
            success: function () {
            }
        })
	});

	
    
	 
});
</script><!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-55069627-12"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-55069627-12');
</script></body></html>